tests: Add some versioning metadata and test it appears in status output
authorColin Walters <walters@verbum.org>
Wed, 22 Oct 2014 15:07:44 +0000 (11:07 -0400)
committerColin Walters <walters@verbum.org>
Thu, 23 Oct 2014 15:24:44 +0000 (11:24 -0400)
Followup to previous commits.

tests/admin-test.sh
tests/libtest.sh

index 85be1f7e1d52f87809359aad77256ebc1deddf23..94aef64cf5e67ff30eccc9ae80451c73d1a727ff 100755 (executable)
@@ -26,7 +26,9 @@ rev=$(ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runt
 export rev
 # This initial deployment gets kicked off with some kernel arguments 
 ostree admin --sysroot=sysroot deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime
-ostree admin --sysroot=sysroot status
+ostree admin --sysroot=sysroot status | tee status.txt
+
+assert_file_has_content status.txt 'Version: 1.0.10'
 
 echo "ok deploy command"
 
@@ -46,6 +48,7 @@ assert_file_has_content sysroot/ostree/deploy/testos/deploy/${rev}.0/etc/os-rele
 assert_file_has_content sysroot/ostree/boot.1/testos/${bootcsum}/0/etc/os-release 'NAME=TestOS'
 ostree admin --sysroot=sysroot status
 
+
 echo "ok layout"
 
 ostree admin --sysroot=sysroot deploy --os=testos testos:testos/buildmaster/x86_64-runtime
index 459040d39de926d4d72a864dd96a496c59dbe09b..5abbedf24b931d3347b362fa36decd2599c6fd6a 100644 (file)
@@ -143,13 +143,13 @@ setup_fake_remote_repo1() {
     mkdir baz
     echo moo > baz/cow
     echo alien > baz/saucer
-    ${CMD_PREFIX} ostree  --repo=${test_tmpdir}/ostree-srv/gnomerepo commit -b main -s "A remote commit" -m "Some Commit body"
+    ${CMD_PREFIX} ostree  --repo=${test_tmpdir}/ostree-srv/gnomerepo commit --add-metadata-string version=3.0 -b main -s "A remote commit" -m "Some Commit body"
     mkdir baz/deeper
-    ${CMD_PREFIX} ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit -b main -s "Add deeper"
+    ${CMD_PREFIX} ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit --add-metadata-string version=3.1 -b main -s "Add deeper"
     echo hi > baz/deeper/ohyeah
     mkdir baz/another/
     echo x > baz/another/y
-    ${CMD_PREFIX} ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit -b main -s "The rest"
+    ${CMD_PREFIX} ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit --add-metadata-string version=3.2 -b main -s "The rest"
     cd ..
     rm -rf gnomerepo-files
     
@@ -227,19 +227,19 @@ EOF
     mkdir -p usr/etc/testdirectory
     echo "a default daemon file" > usr/etc/testdirectory/test
 
-    ostree --repo=${test_tmpdir}/testos-repo commit -b testos/buildmaster/x86_64-runtime -s "Build"
+    ostree --repo=${test_tmpdir}/testos-repo commit --add-metadata-string version=1.0.9 -b testos/buildmaster/x86_64-runtime -s "Build"
     
     # Ensure these commits have distinct second timestamps
     sleep 2
     echo "a new executable" > usr/bin/sh
-    ostree --repo=${test_tmpdir}/testos-repo commit -b testos/buildmaster/x86_64-runtime -s "Build"
+    ostree --repo=${test_tmpdir}/testos-repo commit --add-metadata-string version=1.0.10 -b testos/buildmaster/x86_64-runtime -s "Build"
 
     cd ${test_tmpdir}
     cp -a osdata osdata-devel
     cd osdata-devel
     mkdir -p usr/include
     echo "a development header" > usr/include/foo.h
-    ostree --repo=${test_tmpdir}/testos-repo commit -b testos/buildmaster/x86_64-devel -s "Build"
+    ostree --repo=${test_tmpdir}/testos-repo commit --add-metadata-string version=1.0.9 -b testos/buildmaster/x86_64-devel -s "Build"
 
     ostree --repo=${test_tmpdir}/testos-repo fsck -q
 
@@ -293,6 +293,8 @@ os_repository_new_commit ()
 
     echo "content iteration ${content_iteration}" > usr/bin/content-iteration
 
-    ostree --repo=${test_tmpdir}/testos-repo commit -b testos/buildmaster/x86_64-runtime -s "Build"
+    version=$(date "+%Y%m%d.${content_iteration}")
+
+    ostree --repo=${test_tmpdir}/testos-repo commit  --add-metadata-string "version=${version}" -b testos/buildmaster/x86_64-runtime -s "Build"
     cd ${test_tmpdir}
 }